package com.rizzo.shell.intern.host;

import com.google.common.base.Strings;
import com.rizzo.shell.intern.RizzoCommands;

public class MysqlHost {

    private int node;
    private String host;
    private String port;
    private String username;
    private String password;
    private String database;
    private boolean dev;

    public MysqlHost(int node, String host, String port, String username, String password, String database, boolean dev) {
        this.node = node;
        this.host = host;
        this.port = port;
        this.username = username;
        this.password = password;
        this.database = database;
        this.dev = dev;
    }

    public int getNode() {
        return node;
    }

    public void setNode(int node) {
        this.node = node;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getDatabase() {
        return database;
    }

    public void setDatabase(String database) {
        this.database = database;
    }

    public boolean isDev() {
        return dev;
    }

    public void setDev(boolean dev) {
        this.dev = dev;
    }

    @Override
    public String toString() {
        return Strings.padEnd(String.valueOf(node), RizzoCommands.WIDE_TAB_PADDING, ' ')
                + Strings.padEnd(host, RizzoCommands.WIDE_TAB_PADDING, ' ')
                + Strings.padEnd(port, RizzoCommands.WIDE_TAB_PADDING, ' ')
                + Strings.padEnd(database, RizzoCommands.WIDE_TAB_PADDING, ' ')
                + Strings.padEnd(username, RizzoCommands.WIDE_TAB_PADDING, ' ')
                + Strings.padEnd(String.valueOf(dev), RizzoCommands.WIDE_TAB_PADDING, ' ');
    }

}